
/**
 * AppleIIGo
 * MIG (Magic Interface Glue) class
 * (C) 2008 by Marc S. Ressl(mressl@umich.edu)
 * Released under the GPL
 */

#include "Motherboard.h"

#ifndef MIG_H
#define MIG_H

#define MIGBANK_BYTENUM		0x20
#define MIGBANK_NUM			64
#define MIGMEMORY_BYTENUM	(MIGBANK_BYTENUM * MIGBANK_NUM)

class MIG : public Device {
public:
	MIG(class Motherboard * motherboard);
	
	void onDevicesConnected();
	void onMemoryRequested();
	void onMemoryAllocated();
	void onResetAsserted(bool isRestart);
	
	void writeIo(UINT16 address, UINT8 value);
	UINT8 readIo(UINT16 address);
	
private:
	class MMU * mmu;
	class TimingGenerator * timingGenerator;
	class SlotDevice * internalSlot6Device;
	
	UINT32 migMemoryOffset;
	UINT8 * migMemory;
	
	UINT32 migBankOffset;
};

#endif
